package com.zzptc.zhongyuanqing.exam;

import android.content.Intent;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

public class WelcomeActivity extends AppCompatActivity {
    ImageView imgview;
    TextView tv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
        imgview = (ImageView) findViewById(R.id.img);
        tv = (TextView) findViewById(R.id.txt_banquan);

        showlog();



    }



    private void showlog() {


        new Handler(new Handler.Callback() {
            @Override
            public boolean handleMessage(Message message) {
               imgview.setVisibility(View.VISIBLE);
                tv.setVisibility(View.VISIBLE);
                gohome();
                return false;
            }
        }).sendEmptyMessageDelayed(0, 1000);


    }


    private void gohome() {

        new Handler(new Handler.Callback() {
            @Override
            public boolean handleMessage(Message message) {

                startActivity(new Intent(WelcomeActivity.this,HomeActivity.class));

                return false;
            }
        }).sendEmptyMessageDelayed(0, 3000);


    }
}
